package oen.game.csv.loader.data;

import im.oen.boot.common.data.Base;

import java.lang.reflect.Field;
import java.lang.reflect.Type;

/**
 * <p>描述：字段提取的数据结构</p>
 *
 * <p>创建时间：2021-11-09 12:31</p>
 * <p>更新时间：暂无</p>
 *
 * @author Kevin.Xu
 * @version 1.0
 */
public class FieldData extends Base {
    /**
     * 字段
     */
    private Field field;
    /**
     * 字段类型
     */
    private Type declaringType;

    /**
     * 下标
     */
    private int idx;
    /**
     * 默认值
     */
    private String defaultValue;
    /**
     * LIST类型的分隔符
     */
    private String splitSymbol = ",";
    /**
     * 是否是ID字段
     */
    private boolean id = false;
    /**
     * 是否是父级ID字段
     */
    private boolean parentId = false;
    /**
     * 是否是分组字段
     */
    private boolean groupId = false;

    public FieldData() {
    }

    public FieldData(Field field) {
        this.field = field;
    }

    public int getIdx() {
        return idx;
    }

    public void setIdx(int idx) {
        this.idx = idx;
    }

    public String getSplitSymbol() {
        return splitSymbol;
    }

    public void setSplitSymbol(String splitSymbol) {
        this.splitSymbol = splitSymbol;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    public Type getDeclaringType() {
        return declaringType;
    }

    public void setDeclaringType(Type declaringType) {
        this.declaringType = declaringType;
    }

    public Field getField() {
        return field;
    }

    public void setField(Field field) {
        this.field = field;
    }

    public boolean isId() {
        return id;
    }

    public void setId(boolean id) {
        this.id = id;
    }

    public boolean isParentId() {
        return parentId;
    }

    public void setParentId(boolean parentId) {
        this.parentId = parentId;
    }

    public boolean isGroupId() {
        return groupId;
    }

    public void setGroupId(boolean groupId) {
        this.groupId = groupId;
    }
}
